package com.API.dal.entities;

// Generated 03.06.2013 4:15:36 by Hibernate Tools 4.0.0

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * IncomesCustomersProjects generated by hbm2java
 */
@Entity
@Table(name = "INCOMES_CUSTOMERS_PROJECTS", schema = "PUBLIC", catalog = "PUBLIC", uniqueConstraints = @UniqueConstraint(columnNames = {
		"INCOME_ID", "PROJECT_ID", "CUSTOMER_ID" }))
public class IncomesCustomersProjects implements java.io.Serializable {

	private IncomesCustomersProjectsId id;
	private Objects objectsByCustomerId;
	private Objects objectsByProjectId;
	private Incomes incomes;

	public IncomesCustomersProjects() {
	}

	public IncomesCustomersProjects(IncomesCustomersProjectsId id,
			Objects objectsByCustomerId, Objects objectsByProjectId,
			Incomes incomes) {
		this.id = id;
		this.objectsByCustomerId = objectsByCustomerId;
		this.objectsByProjectId = objectsByProjectId;
		this.incomes = incomes;
	}

	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "incomeId", column = @Column(name = "INCOME_ID", nullable = false)),
			@AttributeOverride(name = "projectId", column = @Column(name = "PROJECT_ID", nullable = false)),
			@AttributeOverride(name = "customerId", column = @Column(name = "CUSTOMER_ID", nullable = false)) })
	public IncomesCustomersProjectsId getId() {
		return this.id;
	}

	public void setId(IncomesCustomersProjectsId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CUSTOMER_ID", nullable = false, insertable = false, updatable = false)
	public Objects getObjectsByCustomerId() {
		return this.objectsByCustomerId;
	}

	public void setObjectsByCustomerId(Objects objectsByCustomerId) {
		this.objectsByCustomerId = objectsByCustomerId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PROJECT_ID", nullable = false, insertable = false, updatable = false)
	public Objects getObjectsByProjectId() {
		return this.objectsByProjectId;
	}

	public void setObjectsByProjectId(Objects objectsByProjectId) {
		this.objectsByProjectId = objectsByProjectId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "INCOME_ID", nullable = false, insertable = false, updatable = false)
	public Incomes getIncomes() {
		return this.incomes;
	}

	public void setIncomes(Incomes incomes) {
		this.incomes = incomes;
	}

}
